/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Message;

import Core.IMessageHandler;
import Core.MessageBuilder;
import Core.StringUtil;

/**
 *
 * @author Mr Bao
 */
public class FriendReplyMessageHandler implements IMessageHandler {

    public Object Process(String message) {
        int index = message.indexOf(MessageBuilder.ONE);
        String tmp = message.substring(index + 1);
        String[] content = StringUtil.Split(tmp, MessageBuilder.TWO.charAt(0));
        String from = content[0];
        String to = content[1];
        String msg2 = tmp.substring(from.length() + to.length() + 2, tmp.length());
        return new FriendReplyMessage(from, to, msg2);
    }
}
